from django.conf.urls import patterns, include, url
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from django.contrib.auth.views import login, logout
from companies.views import index_db_company
from dajaxice.core import dajaxice_autodiscover, dajaxice_config
from django.conf import settings
# from countries_states.urls import urlpatterns as csurls

admin.autodiscover()

dajaxice_autodiscover()

urlpatterns = patterns('',
    url(r'^$', 'NoName.views.index'),
    url(r'^precios/$', 'NoName.views.prizing_tables'),
    url(r'^blog/$', 'NoName.views.blog'),
    url(r'^blog/post/$', 'NoName.views.post'),
    url(r'^QuienesSomos/$', 'NoName.views.about_us'),
    url(r'^contactanos/$', 'NoName.views.contact_us'),
    url(r'^faqs/$', 'NoName.views.faqs'),
    url(r'^RecuperarDatos/$', 'NoName.views.recover_data'),
    url(r'^reclutadores/$', 'NoName.views.companies', name='NoName_companies'),
    # Uncomment the admin/doc line below to enable admin documentation:
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    (r'^i18n/', include('django.conf.urls.i18n')),
    # (r'^cuentas/', include('registration.backends.default.urls')),
    (r'^', include('userprofiles.urls')),
    url(r'^chaining/', include('smart_selects.urls')),
    url(dajaxice_config.dajaxice_url, include('dajaxice.urls')),
)

urlpatterns += patterns('companies.views',
    url(r'^PanelDeControl/Empresa/$', 'index_db_company', name='companies_index_db_company'),
    url(r'^vacantes/activas/$', 'show_vacancies', {'codename_status': 'active'},  name='companies_active_vacancies'),
    url(r'^vacantes/inactivas/$', 'show_vacancies', {'codename_status': 'inactive'},  name='companies_inactive_vacancies'),
    url(r'^vacantes/programadas/$', 'show_vacancies', {'codename_status': 'programmed'},  name='companies_programmed_vacancies'),
    url(r'^vacantes/finalizadas/$', 'show_vacancies', {'codename_status': 'finalized'},  name='companies_finalized_vacancies'),
    url(r'^vacantes/eliminadas/$', 'show_vacancies', {'codename_status': 'removed'},  name='companies_removed_vacancies'),
    url(r'^PanelDeControl/PublicarVacante/$', 'add_vacancy', name='companies_add_vacancy'),
    url(r'^PanelDeControl/EditarVacante/(?P<vacancy_id>\d+)/$', 'update_vacancy', name='companies_update_vacancy'),
    url(r'^PanelDeControl/EliminarVacante/(?P<vacancy_id>\d+)/$', 'deactivate_vacancy', name='companies_deactivate_vacancy'),
    url(r'^PanelDeControl/RePublicarVacante/(?P<vacancy_id>\d+)/$', 'republish_vacancy', name='companies_republish_vacancy'),
)

urlpatterns += patterns('vacancies.views',
    url(r'^vacantes/$', 'vacancies_list'),
)

# urlpatterns += csurls

# Rosetta is a Django application that eases the translation process.
if 'rosetta' in settings.INSTALLED_APPS:
    urlpatterns += patterns('',
        url(r'^rosetta/', include('rosetta.urls')),
    )
